//
//  TGBottomMenuItem.m
//  GroupBuy
//
//  Created by wwj on 15/11/4.
//  Copyright © 2015年 wwj. All rights reserved.
//

#import "TGBottomMenuItem.h"
#import "UIImage+Extend.h"
#import "TGSubtitlesView.h"


@implementation TGBottomMenuItem
- (instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        // 2.文字颜色
        [self setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
        self.titleLabel.font = [UIFont systemFontOfSize:16];
        
        // 3.设置被选中时的背景
        [self setBackgroundImage:[UIImage resizedImage:@"bg_filter_toggle_hl.png"] forState:UIControlStateSelected];
        
        //添加分割线
        UIImage *img = [UIImage imageNamed:@"separator_filter_item"];
        UIImageView *divider = [[UIImageView alloc] initWithImage:img];
        divider.bounds = CGRectMake(0, 0, 2, kBottomMenuItemH * 0.7);
        divider.center = CGPointMake(kBottomMenuItemW, kBottomMenuItemH * 0.5);
        [self addSubview:divider];
    }
    return self;
}

-(void)setHighlighted:(BOOL)highlighted{}

-(void)setFrame:(CGRect)frame{
    frame.size = CGSizeMake(kBottomMenuItemW, kBottomMenuItemH);
    [super setFrame:frame];
}
@end
